Advances in technology have resulted in electronic devices (e.g., “internet of things” (IoT) devices) being used to share larger amounts of data with other devices. However, many of these electronic devices are small and may lack the memory resources needed to store the substantial amount of data being generated. Additionally, sharing such data between devices may result in substantial network overhead. To address these concerns, data compression techniques are used to decrease the size of the data. One technique for compressing data is Huffman coding.
To encode data using Huffman coding, data is analyzed to determine the number of occurrences of each possible value, and a Huffman table is generated that maps more frequently occurring values to smaller codewords and less frequently occurring values to larger codewords. To enable a decoder to decode data that is encoded using a particular Huffman code, the encoder sends (e.g., in a header or other portion of the data) encoding data indicative of the particular Huffman code. For larger Huffman tables, the size of the encoding data can be substantial, which reduces the amount of compressed data that can be stored at a memory or increases overhead in a network due to the transmission of the encoding data in addition to the compressed data.